PROJECT(gmDisplay)
FIND_PACKAGE(Boost)
IF(Boost_FOUND)
  MESSAGE(STATUS "Boost found")
ELSE(Boost_FOUND)
  MESSAGE(FATAL_ERROR "Cannot build without Boost.")
ENDIF(Boost_FOUND)

FIND_PACKAGE(SDL REQUIRED)
Find_Package ( SDL_image REQUIRED ) 
IF ( SDL_FOUND )
   MESSAGE ( STATUS "SDL found" )
ELSE(SDL_FOUND)
      MESSAGE(FATAL_ERROR "Cannot build without SDL")
      SET(BUILD_MODULE_FALSE)
ENDIF (SDL_FOUND)
FIND_PACKAGE(OpenGL REQUIRED) 
IF (OPENGL_FOUND)  
      MESSAGE(STATUS  "OpenGL found") 
ELSE (OPENGL_FOUND)  
      MESSAGE(FATAL_ERROR  "Cannot build without OpenGL") 
      SET(BUILD_MODULE FALSE) 
ENDIF (OPENGL_FOUND)  
FIND_PACKAGE(GLUT REQUIRED) 
IF (GLUT_FOUND)  
      MESSAGE(STATUS  "GLUT found") 
ELSE (GLUT_FOUND)  
      MESSAGE(FATAL_ERROR "Cannot build without GLUT") 
      SET(BUILD_MODULE FALSE) 
ENDIF (GLUT_FOUND)  




include_directories (${geomagick_SOURCE_DIR} ${geomagick_SOURCE_DIR}/src ${Boost_INCLUDE_DIRS} ${OPENGL_INCLUDE_DIR} ${GLUT_INCLUDE_DIR} )
link_directories (${Boots_LIBRARY_DIRS} ${geomagick_SOURCE_DIR}/src ${OPENGL_INCLUDE_DIR} ${GLUT_INCLUDE_DIR})


#if you don't want the full compiler output, remove the following line
SET(CMAKE_VERBOSE_MAKEFILE ON)

#add definitions, compiler switches, etc.
ADD_DEFINITIONS(-g -Wall -O0)

#list all source files here
ADD_LIBRARY(gmDisplay gmDisplay.cpp gmDisplaySetup.cpp )


# glui needed ???
TARGET_LINK_LIBRARIES(gmDisplay  ${Boost} ${OPENGL_LIBRARIES} ${SDL_LIBRARY} ${SDLIMAGE_LIBRARY}  geomagick ${GLUT_LIBRARY})
